/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package wisimconsole;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.AbstractButton;
import javax.swing.ButtonModel;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import wiBase.WiException;
import wiBase.WiObject;
import wiBase.baseObject.Node;

/**
 *
 * @author brother
 */
public class FilterFrame extends javax.swing.JFrame {
    private static boolean DEBUG=false;
    WiSimConsole console=null;
    ArrayList<CheckListItem> lstNodeItem=new ArrayList<>();
    /**
     * Creates new form FilterFrame
     */
    public FilterFrame(WiSimConsole console) {
        this.console=console;
        
        initComponents();
        initListNode();

        if(DEBUG){
            System.out.println("Filter frame created");
            createDataSample();
        }
        
        //refreshData();

        cb_event_all.addChangeListener(new ChangeListener() {
            @Override
            public void stateChanged(ChangeEvent e) {
                AbstractButton abstractButton = (AbstractButton) e.getSource();
                ButtonModel buttonModel = abstractButton.getModel();
                boolean armed = buttonModel.isArmed();
                boolean pressed = buttonModel.isPressed();
                if (pressed) {
                    boolean selected = buttonModel.isSelected();
                    //System.out.println("Changed: " + armed + "/" + pressed + "/" + selected);
                    cb_event_send.setSelected(selected);
                    cb_event_receive.setSelected(selected);
                    cb_event_forward.setSelected(selected);
                    cb_event_drop.setSelected(selected);
		    cb_event_broastcast.setSelected(selected);
                    cb_event_sleep.setSelected(selected);
                    cb_event_wake.setSelected(selected);
                    cb_event_move.setSelected(selected);
                }

            }
        });
        
        cb_packet_all.addChangeListener(new ChangeListener() {

            @Override
            public void stateChanged(ChangeEvent e) {
                AbstractButton abstractButton = (AbstractButton) e.getSource();
                ButtonModel buttonModel = abstractButton.getModel();
                boolean armed = buttonModel.isArmed();
                boolean pressed = buttonModel.isPressed();
                if (pressed) {
                    boolean selected = buttonModel.isSelected();
                    //System.out.println("Changed: " + armed + "/" + pressed + "/" + selected);
                    cb_packet_broastcast.setSelected(selected);
                    cb_packet_dropped.setSelected(selected);
                    cb_packet_forwarded.setSelected(selected);
                    cb_packet_normal.setSelected(selected);
                }
            }
        });
        
        cb_node_all.addChangeListener(new ChangeListener() {

            @Override
            public void stateChanged(ChangeEvent e) {
                AbstractButton abstractButton = (AbstractButton) e.getSource();
                ButtonModel buttonModel = abstractButton.getModel();
                boolean armed = buttonModel.isArmed();
                boolean pressed = buttonModel.isPressed();
                if (pressed) {
                    boolean selected = buttonModel.isSelected();
                    //System.out.println("Changed: " + armed + "/" + pressed + "/" + selected);
                    for(CheckListItem item: lstNodeItem){
                        item.setSelected(selected);
			
                    }
                }
            }
        });
        
        
    }
    private void createDataSample(){
        lstNodeItem.add(new CheckListItem(0,"Node 1"));
        lstNodeItem.add(new CheckListItem(1,"Node 2"));
    }
    
    public void refreshData() {
	lstNodeItem.removeAll(lstNodeItem);
        ArrayList<WiObject> lstNode= console.getEngine().getListNodes();
	for(WiObject object: lstNode){
	    Node node=(Node)object;
	    lstNodeItem.add(new CheckListItem(node.id,"Node "+node.id));
	}
        listNode.setListData(lstNodeItem.toArray());
    }

    private void initListNode() {
        listNode.setCellRenderer(new CheckListRenderer());
        listNode.addMouseListener(new MouseAdapter() {
            @Override
            public void mouseClicked(MouseEvent event) {
                JList list = (JList) event.getSource();

                // Get index of item clicked

                int index = list.locationToIndex(event.getPoint());
                CheckListItem item = (CheckListItem) list.getModel().getElementAt(index);

                // Toggle selected state
                item.setSelected(!item.isSelected());

                // Repaint cell
                list.repaint(list.getCellBounds(index, index));
            }
        });
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jpn_event = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        cb_event_send = new javax.swing.JCheckBox();
        cb_event_receive = new javax.swing.JCheckBox();
        cb_event_forward = new javax.swing.JCheckBox();
        cb_event_sleep = new javax.swing.JCheckBox();
        cb_event_wake = new javax.swing.JCheckBox();
        cb_event_drop = new javax.swing.JCheckBox();
        cb_event_move = new javax.swing.JCheckBox();
        cb_event_all = new javax.swing.JCheckBox();
        cb_event_broastcast = new javax.swing.JCheckBox();
        jpn_packet = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        cb_packet_broastcast = new javax.swing.JCheckBox();
        cb_packet_normal = new javax.swing.JCheckBox();
        cb_packet_dropped = new javax.swing.JCheckBox();
        cb_packet_forwarded = new javax.swing.JCheckBox();
        cb_packet_all = new javax.swing.JCheckBox();
        jpn_node = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        listNode = new javax.swing.JList();
        cb_node_all = new javax.swing.JCheckBox();
        jPanel4 = new javax.swing.JPanel();
        btn_event = new javax.swing.JButton();
        btn_packet = new javax.swing.JButton();
        btn_node = new javax.swing.JButton();

        setTitle("Filter");
        setLocationByPlatform(true);
        setMinimumSize(new java.awt.Dimension(519, 404));

        jpn_event.setBorder(javax.swing.BorderFactory.createTitledBorder("Events"));

        jLabel1.setText("Type:");

        cb_event_send.setSelected(true);
        cb_event_send.setText("Send");

        cb_event_receive.setSelected(true);
        cb_event_receive.setText("Receive");

        cb_event_forward.setSelected(true);
        cb_event_forward.setText("Forward");

        cb_event_sleep.setSelected(true);
        cb_event_sleep.setText("Sleep");

        cb_event_wake.setSelected(true);
        cb_event_wake.setText("Wake");

        cb_event_drop.setSelected(true);
        cb_event_drop.setText("Drop");

        cb_event_move.setSelected(true);
        cb_event_move.setText("Move");

        cb_event_all.setSelected(true);
        cb_event_all.setText("All");

        cb_event_broastcast.setSelected(true);
        cb_event_broastcast.setText("Broastcast");

        javax.swing.GroupLayout jpn_eventLayout = new javax.swing.GroupLayout(jpn_event);
        jpn_event.setLayout(jpn_eventLayout);
        jpn_eventLayout.setHorizontalGroup(
            jpn_eventLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpn_eventLayout.createSequentialGroup()
                .addGroup(jpn_eventLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpn_eventLayout.createSequentialGroup()
                        .addComponent(jLabel1)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(cb_event_all))
                    .addGroup(jpn_eventLayout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jpn_eventLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(cb_event_forward)
                            .addComponent(cb_event_receive)
                            .addComponent(cb_event_send)
                            .addComponent(cb_event_sleep)
                            .addComponent(cb_event_wake)
                            .addComponent(cb_event_drop)
                            .addComponent(cb_event_move)
                            .addComponent(cb_event_broastcast))
                        .addGap(0, 6, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jpn_eventLayout.setVerticalGroup(
            jpn_eventLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpn_eventLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpn_eventLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1)
                    .addComponent(cb_event_all))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cb_event_send)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cb_event_receive)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cb_event_forward)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cb_event_drop)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cb_event_broastcast)
                .addGap(18, 18, 18)
                .addComponent(cb_event_sleep)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cb_event_wake)
                .addGap(18, 18, 18)
                .addComponent(cb_event_move)
                .addContainerGap(67, Short.MAX_VALUE))
        );

        jpn_packet.setBorder(javax.swing.BorderFactory.createTitledBorder("Packets"));

        jLabel2.setText("Type:");

        cb_packet_broastcast.setText("Broastcast");

        cb_packet_normal.setText("Normal");

        cb_packet_dropped.setText("Dropped");

        cb_packet_forwarded.setText("Forwarded");

        cb_packet_all.setText("All");

        javax.swing.GroupLayout jpn_packetLayout = new javax.swing.GroupLayout(jpn_packet);
        jpn_packet.setLayout(jpn_packetLayout);
        jpn_packetLayout.setHorizontalGroup(
            jpn_packetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpn_packetLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpn_packetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpn_packetLayout.createSequentialGroup()
                        .addComponent(jLabel2)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(cb_packet_all))
                    .addGroup(jpn_packetLayout.createSequentialGroup()
                        .addGroup(jpn_packetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(cb_packet_forwarded)
                            .addComponent(cb_packet_dropped)
                            .addComponent(cb_packet_normal)
                            .addComponent(cb_packet_broastcast))
                        .addGap(0, 16, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jpn_packetLayout.setVerticalGroup(
            jpn_packetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpn_packetLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpn_packetLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(cb_packet_all))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cb_packet_broastcast)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(cb_packet_normal)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cb_packet_dropped)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(cb_packet_forwarded)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jpn_node.setBorder(javax.swing.BorderFactory.createTitledBorder("Nodes"));

        jLabel3.setText("Id:");

        listNode.setModel(new javax.swing.AbstractListModel() {
            String[] strings = { "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 1", "Item 2", "Item 3", "Item 4", "Item 5", "Item 1", "Item 2", "Item 3", "Item 4", "Item 5" };
            public int getSize() { return strings.length; }
            public Object getElementAt(int i) { return strings[i]; }
        });
        listNode.setToolTipText("List Of Node Id");
        jScrollPane1.setViewportView(listNode);

        cb_node_all.setText("All");

        javax.swing.GroupLayout jpn_nodeLayout = new javax.swing.GroupLayout(jpn_node);
        jpn_node.setLayout(jpn_nodeLayout);
        jpn_nodeLayout.setHorizontalGroup(
            jpn_nodeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpn_nodeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpn_nodeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jpn_nodeLayout.createSequentialGroup()
                        .addComponent(jLabel3)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(cb_node_all))
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 133, Short.MAX_VALUE))
                .addContainerGap())
        );
        jpn_nodeLayout.setVerticalGroup(
            jpn_nodeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jpn_nodeLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jpn_nodeLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3)
                    .addComponent(cb_node_all))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1)
                .addContainerGap())
        );

        btn_event.setText("Filter Event");
        btn_event.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_eventActionPerformed(evt);
            }
        });

        btn_packet.setText("Filter Packets");
        btn_packet.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_packetActionPerformed(evt);
            }
        });

        btn_node.setText("Filter Node");
        btn_node.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btn_nodeActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btn_event)
                .addGap(36, 36, 36)
                .addComponent(btn_packet)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(btn_node)
                .addGap(51, 51, 51))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(btn_event)
                .addComponent(btn_packet)
                .addComponent(btn_node))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jpn_event, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(jpn_packet, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 22, Short.MAX_VALUE)
                        .addComponent(jpn_node, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jpn_node, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jpn_packet, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jpn_event, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel4, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(7, 7, 7))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btn_eventActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_eventActionPerformed
	boolean traceEventSend=cb_event_send.isSelected();
	boolean traceEventReceive=cb_event_receive.isSelected();
	boolean traceEventForward=cb_event_forward.isSelected();
	boolean traceEventDrop=cb_event_drop.isSelected();
	boolean traceEventBroastcast=cb_event_broastcast.isSelected();
	boolean traceEventSleep=cb_event_sleep.isSelected();
	boolean traceEventWake=cb_event_wake.isSelected();
	boolean traceEventMove=cb_event_move.isSelected();
	
	
	console.mapTraceEvent.put("send", traceEventSend);
	console.mapTraceEvent.put("receive", traceEventReceive);
	console.mapTraceEvent.put("forward", traceEventForward);
	console.mapTraceEvent.put("drop", traceEventDrop);
	console.mapTraceEvent.put("broastcast", traceEventBroastcast);
	console.mapTraceEvent.put("sleep", traceEventSleep);
	console.mapTraceEvent.put("wake", traceEventWake);
	console.mapTraceEvent.put("move", traceEventMove);
	
	this.console.setTraceEvent();
	JOptionPane.showMessageDialog(this, String.format("Filted: \n Send: %s\n Receive: %s\n Forward: %s\n Drop: %s\n Broastcast: %s\n Sleep: %s\n Wake: %s\n Move: %s", 
		traceEventSend,traceEventReceive,traceEventForward,traceEventDrop,traceEventBroastcast,traceEventSleep,traceEventWake,traceEventMove), "Filter", JOptionPane.INFORMATION_MESSAGE);
    }//GEN-LAST:event_btn_eventActionPerformed

    private void btn_packetActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_packetActionPerformed
	try {
	    boolean tracePacketBroastcast=cb_packet_broastcast.isSelected();
	    boolean tracePacketDrop=cb_packet_dropped.isSelected();
	    boolean tracePacketForward=cb_packet_forwarded.isSelected();
	    boolean tracePacketNormal=cb_packet_normal.isSelected();
	    
	    
	    console.addTracePacketToMap("broastcast", tracePacketBroastcast?console.getConsole():null);
	    console.addTracePacketToMap("drop", tracePacketDrop?console.getConsole():null);
	    console.addTracePacketToMap("forward", tracePacketForward?console.getConsole():null);
	    console.addTracePacketToMap("normal", tracePacketNormal?console.getConsole():null);
	    
	    
	    console.addTracePacket();
	    
	    JOptionPane.showMessageDialog(this, String.format("Filted: \n Broastcast: %s\n Drop: %s\n Forward: %s\n Normal: %s", 
		tracePacketBroastcast,tracePacketDrop,tracePacketForward,tracePacketNormal), "Filter", JOptionPane.INFORMATION_MESSAGE);
	} catch (WiException ex) {
	    JOptionPane.showMessageDialog(this, String.format("Exception: %s", 
		ex.getExcepMessage()+"\n"+ex.getMessage()), "Filter Exception", JOptionPane.ERROR_MESSAGE);
	}
    }//GEN-LAST:event_btn_packetActionPerformed

    private void btn_nodeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btn_nodeActionPerformed
	try {
	    int i=0;
	    for(CheckListItem item: lstNodeItem){
		
		try {
		    if(item.isSelected()) i++;
		    console.getEngine().addTraceNode(item.getIdNode(), item.isSelected()?console.getConsole():null);
		} catch (WiException ex) {
		    i--;
		    JOptionPane.showMessageDialog(this, String.format("Exception: %s",
		    ex.getExcepMessage()+"\n"+ex.getMessage()), "Filter Exception", JOptionPane.ERROR_MESSAGE);
		}
	    }
	    
	    console.addTraceNode();
	    JOptionPane.showMessageDialog(this, String.format("Filter Node: %s", 
		    i+" items Filted"),"Filter Nodes", JOptionPane.INFORMATION_MESSAGE);
	} catch (WiException ex) {
	    JOptionPane.showMessageDialog(this, String.format("Exception: %s", 
		ex.getExcepMessage()+"\n"+ex.getMessage()), "Filter Exception", JOptionPane.ERROR_MESSAGE);
	}
    }//GEN-LAST:event_btn_nodeActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(FilterFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(FilterFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(FilterFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(FilterFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new FilterFrame(null).setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btn_event;
    private javax.swing.JButton btn_node;
    private javax.swing.JButton btn_packet;
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JCheckBox cb_event_all;
    private javax.swing.JCheckBox cb_event_broastcast;
    private javax.swing.JCheckBox cb_event_drop;
    private javax.swing.JCheckBox cb_event_forward;
    private javax.swing.JCheckBox cb_event_move;
    private javax.swing.JCheckBox cb_event_receive;
    private javax.swing.JCheckBox cb_event_send;
    private javax.swing.JCheckBox cb_event_sleep;
    private javax.swing.JCheckBox cb_event_wake;
    private javax.swing.JCheckBox cb_node_all;
    private javax.swing.JCheckBox cb_packet_all;
    private javax.swing.JCheckBox cb_packet_broastcast;
    private javax.swing.JCheckBox cb_packet_dropped;
    private javax.swing.JCheckBox cb_packet_forwarded;
    private javax.swing.JCheckBox cb_packet_normal;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JPanel jpn_event;
    private javax.swing.JPanel jpn_node;
    private javax.swing.JPanel jpn_packet;
    private javax.swing.JList listNode;
    // End of variables declaration//GEN-END:variables
}
